using System.Collections.Generic;
using System.Text.RegularExpressions;
using I2.Loc;
using UnityEngine;
using UnityEngine.Purchasing;
using UnityEngine.Purchasing.Extension;
using UnityEngine.UI;

public class IAPManager : MonoBehaviour
{
	public Text goldCountView;
	public Text moneyCountView;
	public void OnClickGetMonemy()
	{
		AdManager.Instance.ShowVideo(
		() =>
			{
				DO.Campaign.balance += 500;
				SaveLoad.SaveString("Campaign", JsonUtility.ToJson(DO.Campaign));
			}
		);
	}
	public void OnClickGetGold()
	{
		AdManager.Instance.ShowVideo(
		() =>
			{
				DO.Player.gold += 5;
				SaveLoad.SaveString("Player", JsonUtility.ToJson(DO.Player));
			}
		);
	}
	public void Open()
	{
		MyAdManager.Instance.MyShowNative();
		base.gameObject.SetActive(value: true);
	}

	public void FixedUpdate()
	{
		goldCountView.text = DO.Player.gold.ToString("n0");
		moneyCountView.text = DO.Campaign.balance.ToString("n0");
	}
}
